home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Taifun / Taifun 097 (1989-05-15)(Ossowski, Stefan)(DE)(PD).zip / Taifun 097 (1989-05-15)(Ossowski, Stefan)(DE)(PD).adf / CopperMonitor / COM.s < prev    next >
Text File  |  1989-04-05  |  9KB  |  503 lines

  1. * Source-Code für COM (COpperMonitor)
  2. * (c) Roger Fischlin 3/89
  3. * Dieses Programm ist Public-Domain !    
  4.  
  5.  
  6.  
  7.     incdir      "vd0:include/"
  8.     include    intuition/intuition.i
  9.     include    intuition/intuition_lib.i
  10.             include     exec/memory.i
  11.     include    exec/exec_lib.i
  12.     include    graphics/graphics_lib.i
  13.     include    libraries/dos_lib.i
  14.     include    libraries/dos.i
  15.     include    graphics/text.i
  16.  
  17. TEXT    macro        ; Macro zur Ausgabe eines Textes
  18.     move    #\1,d0    
  19.     move    #\2,d1    
  20.     move.l    Window,a1
  21.     move.l    wd_RPort(a1),a1
  22.     CALLGRAF    Move        
  23.     move    #\3,d0    
  24.     move.l    Window,a1
  25.     move.l    wd_RPort(a1),a1
  26.     CALLGRAF    SetAPen
  27.     lea    \4,a0    
  28.     move.l    #\5,d0    
  29.     move.l    Window,a1        
  30.     move.l    wd_RPort(a1),a1    
  31.     CALLGRAF    Text
  32.     endm
  33.  
  34.     include    misc/easystart.i
  35.     lea    intname(pc),a1    
  36.     moveq    #0,d0        
  37.     CALLEXEC     OpenLibrary
  38.     move.l    d0,_IntuitionBase 
  39.     lea    grafname(pc),a1    
  40.     moveq    #0,d0
  41.     CALLEXEC     OpenLibrary
  42.     move.l    d0,_GfxBase
  43.     move.l    d0,a0
  44.     move.l    38(a0),Addresse  
  45.     lea    windowdef,a0     
  46.     CALLINT    OpenWindow
  47.     move.l    d0,Window    
  48.     tst.l    d0     
  49.     beq    exit
  50.     move    #0,d0    
  51.     move.l    Window,a1
  52.     move.l    wd_RPort(a1),a1
  53.     CALLGRAF    SetBPen
  54.     move    #RP_JAM2,d0    
  55.     move.l    Window,a1
  56.     move.l    wd_RPort(a1),a1
  57.     CALLGRAF    SetDrMd
  58.     lea.l    FONT,a0            
  59.     CALLGRAF    OpenFont           
  60.     move.l    d0,Font
  61.     move.l    d0,a0
  62.     move.l    Window,a1
  63.     move.l    wd_RPort(a1),a1
  64.     CALLGRAF    SetFont
  65.     move    #1,d0    
  66.     move.l    Window,a1
  67.     move.l    wd_RPort(a1),a1
  68.     CALLGRAF    SetAPen
  69.     move    #0,d0    
  70.     move.l    Window,a1
  71.     move.l    wd_RPort(a1),a1
  72.     CALLGRAF    SetBPen
  73.     move    #RP_JAM2,d0    
  74.     move.l    Window,a1
  75.     move.l    wd_RPort(a1),a1
  76.     CALLGRAF    SetDrMd
  77.  
  78.     move.l    #2*204,d0
  79.     move.l    #2,d1
  80.     CALLEXEC    AllocMem
  81.     move.l    d0,Im1_Mem
  82.     beq    closewindow
  83.     move.l    d0,a0        
  84.     add.l    #204,d0
  85.     move.l    d0,Im2_Mem
  86.     lea.l    Pfeil1,a1
  87.     move.l    #2*204-1,d0
  88. label1    move.b    (a1)+,(a0)+
  89.     dbra    d0,label1
  90.     lea.l    Gadget1,a0
  91.     move.l    Window,a1
  92.     sub.l    a2,a2
  93.     CALLINT    RefreshGadgets
  94.  
  95.     moveq    #0,d0    
  96.     move    #177,d1    
  97.     move.l    Window,a1
  98.     move.l    wd_RPort(a1),a1
  99.     CALLGRAF    Move        
  100.     move    #1,d0    
  101.     move.l    Window,a1
  102.     move.l    wd_RPort(a1),a1
  103.     CALLGRAF    SetAPen
  104.     move.l    #400,d0    
  105.     move    #177,d1
  106.     move.l    Window,a1        
  107.     move.l    wd_RPort(a1),a1    
  108.     CALLGRAF    Draw
  109.     
  110. back    jsr    Print
  111.     move.l    _GfxBase,a0
  112.     move.l    38(a0),d2
  113.     lsl.l    #8,d2
  114.     lea.l    Text2+10,a0
  115.     moveq.l    #5,d1
  116. bnext    rol.l    #4,d2
  117.     move.l    d2,d3
  118.     and.b    #$f,d3
  119.     add.b    #"0",d3
  120.     cmp.b    #58,d3
  121.     bcs    bout
  122.     addq    #7,d3
  123. bout    move.b    d3,(a0)+
  124.     dbra    d1,bnext
  125.     
  126.     TEXT    250,(205-14),3,Text2,16
  127.  
  128.  
  129.  
  130.  
  131. wait    move.l    Window,a0        
  132.     move.l    wd_UserPort(a0),a0
  133.     CALLEXEC    GetMsg
  134.     tst.l    d0
  135.     beq    wait
  136.     move.l    d0,a1    
  137.     move.l    im_Class(a1),d4
  138.     move.l    im_IAddress(a1),a4    
  139.     CALLEXEC     ReplyMsg
  140.     cmp.l    #CLOSEWINDOW,d4
  141.     beq    QUIT
  142.     moveq.l    #0,d0
  143.     move.w    gg_GadgetID(a4),d0
  144.     subq    #1,d0
  145.     lsl.l    #2,d0
  146.     add.l    #Vektoren,d0
  147.     move.l    d0,a0
  148.     move.l    (a0),a0
  149.     jmp    (a0)
  150. Vektoren    dc.l    DOWN,UP,GFX,wait
  151.  
  152.  
  153. QUIT    move.l    Im1_Mem,a1
  154.     move.l    #2*204,d0
  155.     CALLEXEC    FreeMem    
  156. closewindow    move.l    Window,a0
  157.     CALLINT    CloseWindow
  158. exit    moveq    #0,d0            
  159.     rts                
  160.  
  161. W_Gadgets equ   WINDOWDRAG!WINDOWDEPTH!WINDOWCLOSE
  162. W_Extras  equ   SMART_REFRESH!ACTIVATE
  163.     even
  164. windowdef      dc.w    110,0
  165.     dc.w    400,200
  166.     dc.b    -1,-1
  167.     dc.l    CLOSEWINDOW!GADGETDOWN!GADGETUP
  168.             dc.l        W_Gadgets!W_Extras  
  169.     dc.l    Gadget1    
  170.     dc.l    0    
  171.     dc.l    Title
  172.     dc.l    0    
  173.     dc.l    0    
  174.     dc.w    200,60
  175.             dc.w        512,640
  176.     dc.w    WBENCHSCREEN
  177. Title    dc.b    "COM  by Roger Fischlin 3/89",0    
  178.  
  179.  
  180. Gadget1    dc.l    Gadget2
  181.     dc.w    20,-19,34,17
  182.     dc.w    GADGHNONE!GRELBOTTOM!GADGIMAGE
  183.     dc.w    GADGIMMEDIATE
  184.     dc.w    BOOLGADGET
  185.     dc.l    Image1,0
  186.     dc.l    0
  187.     dc.l    0,0
  188.     dc.w    1
  189.     dc.l    0
  190. Gadget2    dc.l    Gadget3
  191.     dc.w    20+50,-19,34,17
  192.     dc.w    GADGHNONE!GRELBOTTOM!GADGIMAGE
  193.     dc.w    GADGIMMEDIATE
  194.     dc.w    BOOLGADGET
  195.     dc.l    Image2,0
  196.     dc.l    0
  197.     dc.l    0,0
  198.     dc.w    2
  199.     dc.l    0
  200. Gadget3    dc.l    0
  201.     dc.w    20+110+30,-19,54,17
  202.     dc.w    GADGHCOMP!GRELBOTTOM
  203.     dc.w    RELVERIFY
  204.     dc.w    BOOLGADGET
  205.     dc.l    Border1,0
  206.     dc.l    Text1
  207.     dc.l    0,0
  208.     dc.w    3
  209.     dc.l    0
  210.  
  211. Text1    dc.b    3,1,RP_JAM1,0
  212.     dc.w    15,5
  213.     dc.l    FONT,T1,0
  214. T1    dc.b    "GFX",0
  215. Border1    dc.w    0,0
  216.     dc.b    2,0,RP_JAM1,5
  217.     dc.l    koor,0
  218. koor    dc.w    0,0,53,0,53,16,0,16,0,0
  219. Text2    dc.b    "Copper : $------"
  220.  
  221. intname    INTNAME    
  222. grafname    GRAFNAME
  223. dosname    DOSNAME    
  224. _IntuitionBase    ds.l    1    
  225. _GfxBase    ds.l    1
  226. _DOSBase    ds.l    1
  227. Window    ds.l    1
  228. Font    dc.l    0
  229. Memory    dc.l    0
  230. Addresse    dc.l    CList
  231. FONT    dc.l    fontname
  232.     dc.w    TOPAZ_EIGHTY
  233.     dc.b    FS_NORMAL
  234.     dc.b    FPF_ROMFONT
  235.     even 
  236. fontname    dc.b    "topaz.font",0
  237.     even
  238.  
  239.  
  240. Pfeil1    dc.b $7f,$ff,$ff,$ff,$80,$00,$c0,$00,$00,$00,$c0,$00,$80,$03,$f0,$00
  241.     dc.b $40,$00,$80,$03,$f0,$00,$40,$00,$80,$03,$f0,$00,$40,$00,$80,$03
  242.     dc.b $f0,$00,$40,$00,$80,$03,$f0,$00,$40,$00,$80,$03,$f0,$00,$40,$00
  243.     dc.b $8f,$ff,$ff,$fc,$40,$00,$83,$ff,$ff,$f0,$40,$00,$80,$ff,$ff,$c0
  244.     dc.b $40,$00,$80,$3f,$ff,$00,$40,$00,$80,$0f,$fc,$00,$40,$00,$80,$03
  245.     dc.b $f0,$00,$40,$00,$80,$00,$c0,$00,$40,$00,$c0,$00,$00,$00,$c0,$00
  246.     dc.b $7f,$ff,$ff,$ff,$80,$00,$7f,$ff,$ff,$ff,$80,$00,$ff,$ff,$ff,$ff
  247.     dc.b $c0,$00,$ff,$fc,$0f,$ff,$c0,$00,$ff,$fc,$0f,$ff,$c0,$00,$ff,$fc
  248.     dc.b $0f,$ff,$c0,$00,$ff,$fc,$0f,$ff,$c0,$00,$ff,$fc,$0f,$ff,$c0,$00
  249.     dc.b $ff,$fc,$0f,$ff,$c0,$00,$f0,$00,$00,$03,$c0,$00,$fc,$00,$00,$0f
  250.     dc.b $c0,$00,$ff,$00,$00,$3f,$c0,$00,$ff,$c0,$00,$ff,$c0,$00,$ff,$f0
  251.     dc.b $03,$ff,$c0,$00,$ff,$fc,$0f,$ff,$c0,$00,$ff,$ff,$3f,$ff,$c0,$00
  252.     dc.b $ff,$ff,$ff,$ff,$c0,$00,$7f,$ff,$ff,$ff,$80,$00
  253.     
  254. Pfeil2    dc.b $7f,$ff,$ff,$ff,$80,$00,$c0,$00,$00,$00,$c0,$00,$80,$00,$c0,$00
  255.     dc.b $40,$00,$80,$03,$f0,$00,$40,$00,$80,$0f,$fc,$00,$40,$00,$80,$3f
  256.     dc.b $ff,$00,$40,$00,$80,$ff,$ff,$c0,$40,$00,$83,$ff,$ff,$f0,$40,$00
  257.     dc.b $8f,$ff,$ff,$fc,$40,$00,$80,$03,$f0,$00,$40,$00,$80,$03,$f0,$00
  258.     dc.b $40,$00,$80,$03,$f0,$00,$40,$00,$80,$03,$f0,$00,$40,$00,$80,$03
  259.     dc.b $f0,$00,$40,$00,$80,$03,$f0,$00,$40,$00,$c0,$00,$00,$00,$c0,$00
  260.     dc.b $7f,$ff,$ff,$ff,$80,$00,$7f,$ff,$ff,$ff,$80,$00,$ff,$ff,$ff,$ff
  261.     dc.b $c0,$00,$ff,$ff,$3f,$ff,$c0,$00,$ff,$fc,$0f,$ff,$c0,$00,$ff,$f0
  262.     dc.b $03,$ff,$c0,$00,$ff,$c0,$00,$ff,$c0,$00,$ff,$00,$00,$3f,$c0,$00
  263.     dc.b $fc,$00,$00,$0f,$c0,$00,$f0,$00,$00,$03,$c0,$00,$ff,$fc,$0f,$ff
  264.     dc.b $c0,$00,$ff,$fc,$0f,$ff,$c0,$00,$ff,$fc,$0f,$ff,$c0,$00,$ff,$fc
  265.     dc.b $0f,$ff,$c0,$00,$ff,$fc,$0f,$ff,$c0,$00,$ff,$fc,$0f,$ff,$c0,$00
  266.     dc.b $ff,$ff,$ff,$ff,$c0,$00,$7f,$ff,$ff,$ff,$80,$00
  267.  
  268.  
  269. Image1    dc.w    -8,0,40,17,2
  270. Im1_Mem    dc.l    Pfeil1
  271.     dc.b    1+2,0
  272.     dc.l    0
  273. Image2    dc.w    -8,0,40,17,2
  274. Im2_Mem    dc.l    Pfeil2
  275.     dc.b    1+2,0
  276.     dc.l    0
  277.  
  278. UP    sub.l    #4,Addresse
  279.     jmp    back
  280. DOWN    add.l    #4,Addresse
  281.     jmp    back
  282. GFX    move.l    _GfxBase,a0
  283.     move.l    38(a0),Addresse
  284.     jmp    back
  285. NEW    jmp    wait
  286.     
  287.  
  288. Zeile    dc.b    "$ ----- : -----                                           "
  289.  
  290. Print    move.l    #0,d6
  291.     move.l    Addresse,a5
  292. Pr1    lea.l    Zeile+2(pc),a0
  293.     moveq.l    #5,d1
  294.     move.l    a5,d2
  295.     rol.l    #8,d2
  296.  
  297. next    rol.l    #4,d2
  298.     move.l    d2,d3
  299.     and.b    #$f,d3
  300.     add.b    #"0",d3
  301.     cmp.b    #58,d3
  302.     bcs    out
  303.     addq    #7,d3
  304. out    move.b    d3,(a0)+
  305.     dbra    d1,next
  306.     movem.l    d6/a5,-(sp)
  307.  
  308.     lea.l    Zeile+10,a0
  309.     move.l    #36,d0
  310. Pr2    move.b    #" ",(a0)+
  311.     dbra    d0,Pr2
  312.     lea.l    Zeile+10,a0
  313.     move.l    (a5),d0
  314.     btst    #16,d0
  315.     beq    CMOVE
  316.     btst    #0,d0
  317.     beq    CWAIT
  318.     bne    CSKIP
  319. Pr3    move    #10,d0    
  320.     move.w    d6,d1
  321.     mulu.w    #9,d1
  322.     add    #20,d1
  323.     move.l    Window,a1
  324.     move.l    wd_RPort(a1),a1
  325.     CALLGRAF    Move
  326.     move.b    d6,d0
  327.     and.b    #1,d0
  328.     addq    #1,d0        
  329.     move.l    Window,a1
  330.     move.l    wd_RPort(a1),a1
  331.     CALLGRAF    SetAPen
  332.     lea    Zeile(pc),a0    
  333.     move.l    #45,d0    
  334.     move.l    Window,a1        
  335.     move.l    wd_RPort(a1),a1    
  336.     CALLGRAF    Text
  337.     movem.l    (sp)+,d6/a5
  338.     add.l    #4,a5
  339.     addq    #1,d6
  340.     cmp.w    #18,d6
  341.     bne    Pr1
  342.     rts
  343.  
  344.  
  345. CMOVE    move.l    #"Move",(a0)+
  346.     move.w    #" #",(a0)+
  347.     move.b    #"$",(a0)+
  348.     moveq.l    #3,d1
  349.     move.w    2(a5),d2
  350.     lsl.l    #8,d2
  351.     lsl.l    #8,d2
  352.  
  353. cm_next    rol.l    #4,d2
  354.     move.l    d2,d3
  355.     and.b    #$f,d3
  356.     add.b    #"0",d3
  357.     cmp.b    #58,d3
  358.     bcs    cm_out
  359.     addq    #7,d3
  360. cm_out    move.b    d3,(a0)+
  361.     dbra    d1,cm_next
  362.     move.b    #",",(a0)+
  363.     move.b    #"$",(a0)+
  364.     moveq.l    #2,d1
  365.     move.w    (a5),d2
  366.     and.l    #$1ff,d2
  367.     lsl.l    #8,d2
  368.     lsl.l    #8,d2
  369.     lsl.l    #4,d2
  370.  
  371.  
  372. cm_next2    rol.l    #4,d2
  373.     move.l    d2,d3
  374.     and.b    #$f,d3
  375.     add.b    #"0",d3
  376.     cmp.b    #58,d3
  377.     bcs    cm_out2
  378.     addq    #7,d3
  379. cm_out2    move.b    d3,(a0)+
  380.     dbra    d1,cm_next2
  381.     bra    Pr3
  382. CSKIP    move.l    #"Skip",(a0)+
  383.     bra    CW_2
  384.  
  385. CWAIT    move.l    #"Wait",(a0)+
  386. CW_2    move.w    #" (",(a0)+
  387.     move.b    #"$",(a0)+
  388.     moveq.l    #1,d1
  389.     move.w    (a5),d2
  390.     bclr    #0,d2
  391.     lsl.l    #8,d2
  392.     lsl.l    #8,d2
  393.     lsl.l    #8,d2
  394.  
  395. cw_next    rol.l    #4,d2
  396.     move.l    d2,d3
  397.     and.b    #$f,d3
  398.     add.b    #"0",d3
  399.     cmp.b    #58,d3
  400.     bcs    cw_out
  401.     addq    #7,d3
  402. cw_out    move.b    d3,(a0)+
  403.     dbra    d1,cw_next
  404.     move.b    #",",(a0)+
  405.     move.b    #"$",(a0)+
  406.     moveq.l    #1,d1
  407.     move.w    (a5),d2
  408.     lsl.l    #8,d2
  409.     lsl.l    #8,d2
  410.  
  411.  
  412. cw_next2    rol.l    #4,d2
  413.     move.l    d2,d3
  414.     and.b    #$f,d3
  415.     add.b    #"0",d3
  416.     cmp.b    #58,d3
  417.     bcs    cw_out2
  418.     addq    #7,d3
  419. cw_out2    move.b    d3,(a0)+
  420.     dbra    d1,cw_next2
  421.     move.b    #")",(a0)+
  422.     move.b    #" ",(a0)+
  423.     move.b    #" ",(a0)+
  424.     move.b    #" ",(a0)+
  425.     move.b    #" ",(a0)+
  426.     move.b    #"M",(a0)+
  427.     move.b    #"a",(a0)+
  428.     move.b    #"s",(a0)+
  429.     move.b    #"k",(a0)+
  430.     
  431.  
  432.     move.b    #"(",(a0)+
  433.     move.b    #"$",(a0)+
  434.     moveq.l    #1,d1
  435.     move.w    2(a5),d2
  436.     bclr    #0,d2
  437.     lsl.l    #8,d2
  438.     lsl.l    #8,d2
  439.     lsl.l    #8,d2
  440.  
  441. cw_next3    rol.l    #4,d2
  442.     move.l    d2,d3
  443.     and.b    #$f,d3
  444.     add.b    #"0",d3
  445.     cmp.b    #58,d3
  446.     bcs    cw_out3
  447.     addq    #7,d3
  448. cw_out3    move.b    d3,(a0)+
  449.     dbra    d1,cw_next3
  450.     move.b    #",",(a0)+
  451.     move.b    #"$",(a0)+
  452.     moveq.l    #1,d1
  453.     move.w    2(a5),d2
  454.     bset    #15,d2
  455.     lsl.l    #8,d2
  456.     lsl.l    #8,d2
  457.  
  458.  
  459. cw_next4    rol.l    #4,d2
  460.     move.l    d2,d3
  461.     and.b    #$f,d3
  462.     add.b    #"0",d3
  463.     cmp.b    #58,d3
  464.     bcs    cw_out4
  465.     addq    #7,d3
  466. cw_out4    move.b    d3,(a0)+
  467.     dbra    d1,cw_next4
  468.     move.b    #")",(a0)+
  469.     move.b    #" ",(a0)+
  470.     move.b    #" ",(a0)+
  471.     move.w    2(a5),d0
  472.     btst    #15,d0
  473.     bne    cw_1
  474.     move.b    #"B",(a0)+
  475.     move.b    #"F",(a0)+
  476.     
  477. cw_1    bra    Pr3
  478.  
  479.  
  480. CList    dc.w    $180,$aaa
  481.     dc.w    $780f,$fffe
  482.     dc.w    $182,$100
  483.     dc.w    $180,$aaa
  484.     dc.w    $780f,$7ffe
  485.     dc.w    $182,$100
  486.     dc.w    $180,$aaa
  487.     dc.w    $780f,$f0ff
  488.     dc.w    $182,$100
  489.     dc.w    $180,$aaa
  490.     dc.w    $780f,$fffe
  491.     dc.w    $182,$100
  492.     dc.w    $180,$aaa
  493.     dc.w    $780f,$fffe
  494.     dc.w    $182,$100
  495.     
  496.     
  497.  
  498.     
  499.     
  500.  
  501.  
  502.  
  503.